package com.example.demo.mapper;

import com.example.demo.entity.Comment;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface CommentMapper {

    //添加教师评价
    @Insert("insert into comment(student_id,teacher_id,department_id,content,score,create_time)" +
            " values(#{studentId},#{teacherId},#{departmentId},#{content},#{score},now())")
    Integer insertComment(Comment comment);

    //根据学生id和课程id查询
    @Select("select count(1) from comment where student_id=#{sId} and department_id=#{depId}")
    Integer selectBySIdAndDepId(Integer sId,Integer depId);

    //删除
    @Delete("delete from comment where id=#{id}")
    Integer delComment(Integer id);
}
